package com.collection.treemaps;

import java.util.TreeMap;

public class EmptyTreeMapExample {
	public static void main(String[] args) {
		   
	    //create TreeMap object
	    TreeMap treeMap = new TreeMap();
	   
	    //add key value pairs to TreeMap
	    treeMap.put("1","One");
	    treeMap.put("2","Two");
	    treeMap.put("3","Three");
	 
	    /*
	      To remove all values or clear TreeMap use
	      void clear method() of TreeMap class. Clear method removes all
	      key value pairs contained in TreeMap.
	    */
	   
	    treeMap.clear();
	   
	    System.out.println("Total key value pairs in TreeMap are : " + treeMap.size());
	  }
}
